would remove multiple points that are within 1 foot of each other,
leaving just one.
+ You can also specify the "all" option, which would remove all
+ of the points rather than leaving one.
RADIUS
static double pos_dist;
static char *distopt;
+static char *purge_duplicates = NULL;
static char *latopt;
static char *lonopt;
static char *exclopt;
arglist_t position_args[] = {
{"distance", &distopt, "Maximum positional distance",
ARGTYPE_FLOAT | ARGTYPE_REQUIRED },
+ {"all", &purge_duplicates, "Suppress all points close to other points", ARGTYPE_BOOL },
{0, 0, 0, 0}
};
waypoint ** comp;
double dist;
int i, wc;
+ int del = 0;
wc = waypt_count();
if (dist <= pos_dist) {
waypt_del(comp[i]);
waypt_free(comp[i]);
+ del = !!purge_duplicates;
}
+ else if (del ) {
+ waypt_del(comp[i]);
+ waypt_free(comp[i]);
+ del = 0;
+ }
+ }
+ if ( del ) {
+ waypt_del(comp[wc-1]);
+ waypt_free(comp[wc-1]);
}
if (comp)